//
//  HttpRequest.h
//  Block
//
//  Created by MAC on 15/2/10.
//  Copyright (c) 2015年 MAC. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^Result)(NSString* info);
typedef void (^failureResult)(NSError *error);
typedef void  (^Result2)(NSData *data);
@interface HttpRequest : NSObject<NSURLConnectionDataDelegate, NSURLConnectionDelegate>

@property (nonatomic, strong) NSURLConnection *connect;
@property (nonatomic, strong) NSMutableData *mutableData;
@property(nonatomic,strong)NSMutableURLRequest  *request;
@property (nonatomic, copy) Result block;
@property(nonatomic,copy)failureResult  block2;
@property(nonatomic,copy)Result2  block3;
- (void)post:(NSString*)url params:(NSString*)params finish:(Result)block failure:(failureResult)failureBlock;
- (void)post2:(NSString*)url  params:(NSString*)params finish:(Result)block failure:(failureResult)failureBlock;
- (void)get:(NSString*)url  params:(NSString*)params finish:(Result)block failure:(failureResult)failureBlock;

@end
